package com.kui.demo.repeatsubmit;


public abstract class AbstractRepeatSubmitTicket {
    /**
     * 获取凭证
     *
     * @param servletPath 请求路径
     * @param userId      用户ID
     * @return
     */
    public String getTicket(String servletPath, Long userId) {
        return servletPath + "_" + userId;
    }

    /**
     * 获取凭证 时间戳
     *
     * @param ticket
     * @return
     */
    public abstract Long getTicketTimestamp(String ticket);


    /**
     * 设置本次请求时间
     *
     * @param ticket
     */
    public abstract void putTicketTimestamp(String ticket);

    /**
     * 移除凭证
     *
     * @param ticket
     */
    public abstract void removeTicketTimestamp(String ticket);
}
